﻿<%@ Page Title="药品排名" Language="C#" MasterPageFile="~/Master/MasterPage_New.master"
    AutoEventWireup="True" CodeBehind="ProcureMax.aspx.cs" Inherits="ProcureMax" %>

<%@ Register Src="~/Common/QueryControl.ascx" TagName="QueryControl" TagPrefix="uc1" %>
<%@ Register Src="../Common/MaxforMonth.ascx" TagName="MaxforMonth" TagPrefix="uc2" %>
<%@ Register Src="../Common/AreaControls.ascx" TagName="AreaControls" TagPrefix="uc3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script type="text/javascript">
        //add by 曹鹏 2011年4月27日12:20:21 隐藏菜单项
        //        var frameSet2 = top.document.getElementById("mainFrame");
        //        frameSet2.cols = "0,0,*";

        ////        var frameBar2 = top.document.getElementById("bar2");
        ////        frameBar2.src = "";


        function disTime(a) {
            document.getElementById("ctl00_ContentPlaceHolder1_hidTime").value = a;

        }
        function Load() {
            if (document.getElementById("ctl00_ContentPlaceHolder1_hidTime").value == "" || document.getElementById("ctl00_ContentPlaceHolder1_hidTime").value == "rdoTime1") {
                document.getElementById("rdoTime1").checked = true;
            } else {
                document.getElementById("rdoTime2").checked = true;
            }
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="tabnav">
        <ul>
            <li style='<%=HZ.Supervise.Web.Function.CheckMenuByUserID("县区排名")%>'><a href="../Secondphase/ReportArea/ProcureArea.aspx">
                县区排名</a></li>
            <li style='<%=HZ.Supervise.Web.Function.CheckMenuByUserID("城市排名")%>'><a href="ReportArea/RankOfCity.aspx">
                城市排名</a></li>
            <li style='<%=HZ.Supervise.Web.Function.CheckMenuByUserID("医院排名")%>'><a href="ProcureHospitalMax.aspx">
                医院排名</a></li>
            <li style='<%=HZ.Supervise.Web.Function.CheckMenuByUserID("配送排名")%>'><a href="ProcureCompanyPS.aspx">
                配送排名</a></li>
            <li class="active"><a href="javascript:void(0);">药品排名</a></li>
            <li style='<%=HZ.Supervise.Web.Function.CheckMenuByUserID("医院采购类型所占比例")%>'><a href="SortSourceRate.aspx">
                医院采购类型所占比例</a></li>
            <li style='<%=HZ.Supervise.Web.Function.CheckMenuByUserID("县区采购类型所占比例")%>'><a href="SortSourceRateOfArea.aspx">
                县区采购类型所占比例</a></li>
            <li style='<%=HZ.Supervise.Web.Function.CheckMenuByUserID("城市采购类型所占比例")%>'><a href="SortSourceRateOfCity.aspx">
                城市采购类型所占比例</a></li>
            <li style='<%=HZ.Supervise.Web.Function.CheckMenuByUserID("采购单次数")%>'><a href="SortSourceRateCount.aspx">
                采购单次数</a></li>
        </ul>
    </div>
    <div id="tabcontent2">
        <table class="querylist" width="100%">
            <tr>
                <td>
                    <table class="querylist" width="100%">
                        <tr>
                            <td align="right">
                                通用名称：
                            </td>
                            <td align="left">
                                <asp:TextBox runat="server" ID="txtproductname"></asp:TextBox>
                            </td>
                            <td align="right">
                                剂型：
                            </td>
                            <td align="left">
                                <asp:TextBox runat="server" ID="txtMedicineModel"></asp:TextBox>
                            </td>
                            <td align="right">
                                生产企业：
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtCompanyname_sc" runat="server"></asp:TextBox>
                            </td>
                            <td align="right">
                                采购规格：
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtPack" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                采购单位：
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtUnit" runat="server"></asp:TextBox>
                            </td>
                            <td align="right">
                                统计日期：
                            </td>
                            <td align="left">
                                <uc2:MaxforMonth ID="MaxforMonth1" runat="server" />
                                <asp:HiddenField ID="hidTime" runat="server" />
                            </td>
                            <td align="right">
                                地区：
                            </td>
                            <td align="left">
                                <uc3:AreaControls ID="AreaControls1" runat="server" />
                            </td>
                            <td align="right">
                                &nbsp;排名方式：
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlorderby" runat="server">
                                    <asp:ListItem Value="PurchaseAmount">采购金额</asp:ListItem>
                                    <asp:ListItem Value="DistributeAmount">配送金额</asp:ListItem>
                                    <asp:ListItem Value="WareHouseAmount">入库金额</asp:ListItem>
                                    <asp:ListItem Value="DistributeRate">配送率</asp:ListItem>
                                    <asp:ListItem Value="WareHouseRate">入库率</asp:ListItem>
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlorder" runat="server">
                                    <asp:ListItem Value="desc">降序</asp:ListItem>
                                    <asp:ListItem Value="asc">升序</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="60px">
                    <asp:Button ID="btnQuery" runat="server" Text="查  询" OnClick="btnQuery_Click" CssClass="btn"
                        SkinID="search" ToolTip="点击查询符合条件的数据" />
                </td>
            </tr>
        </table>
    </div>
    <asp:GridView ID="gvwProcureCatalog" runat="server" CssClass="mainlist" AutoGenerateColumns="False"
        OnPageIndexChanging="gvwProcureCatalog_PageIndexChanging" EmptyDataText="暂无符合条件的数据！">
        <Columns>
            <asp:BoundField HeaderText="通用名" DataField="ProductName" />
            <asp:BoundField HeaderText="剂型" DataField="MedicineModel" />
            <asp:BoundField HeaderText="采购规格" DataField="Pack" />
            <asp:BoundField HeaderText="采购单位" DataField="Unit" />
            <asp:BoundField HeaderText="生产企业" DataField="CompanyName_SC" />
            <%--<asp:TemplateField HeaderText="采购类型">
				<ItemTemplate>
					<%#HZ.Supervise.Web.Function.FormatDrugSource(Eval("SortSource"))%>
				</ItemTemplate>
				<HeaderStyle Width="60px" />
			</asp:TemplateField>--%>
            <asp:BoundField HeaderText="采购金额" DataField="PurchaseAmountTotal" />
            <asp:BoundField HeaderText="配送金额" DataField="DistributeAmountTotal" />
            <asp:BoundField HeaderText="配送率" DataField="addDistributeRate" />
            <asp:BoundField HeaderText="入库金额" DataField="WareHouseAmountTotal" />
            <asp:BoundField HeaderText="入库率" DataField="addWareHouseRate" />
            <asp:BoundField DataField="apm" HeaderText="本月排名" ReadOnly="true" />
            <%-- <asp:BoundField DataField="addColumnOfRank" HeaderText="上月排名" />--%>
            <asp:TemplateField HeaderText="上月排名">
                <ItemTemplate>
                    <%--<img src='<%# HZ.Supervise.Web.Function.GetImageurl(Eval("pmc")) %>' />--%>
                    <asp:Label runat="server" ID="label" Text='<%#(Convert.ToString(DataBinder.Eval(Container,"DataItem.pm"))) == "0"  ? "无" : (Convert.ToString(DataBinder.Eval(Container,"DataItem.pm"))) %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="名次变化">
                <ItemTemplate>
                    <img src='<%# HZ.Supervise.Web.Function.GetImageurl(Eval("pmc")) %>' />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:GridView ID="gvwProcureCatalog2" runat="server" CssClass="mainlist" AutoGenerateColumns="False"
        OnPageIndexChanging="gvwProcureCatalog_PageIndexChanging">
        <Columns>
            <asp:BoundField HeaderText="通用名" DataField="ProductName" />
            <asp:BoundField HeaderText="剂型" DataField="MedicineModelName" />
            <asp:BoundField HeaderText="采购规格" DataField="Pack" />
            <asp:BoundField HeaderText="采购单位" DataField="Unit" />
            <asp:BoundField HeaderText="生产企业" DataField="CompanyName_SC" />
            <asp:BoundField HeaderText="采购数量" DataField="PurchaseCountTotal" />
            <asp:BoundField HeaderText="采购金额" DataField="PurchaseAmountTotal" />
            <asp:BoundField HeaderText="配送数量" DataField="DistributeCountTotal" />
            <asp:BoundField HeaderText="配送金额" DataField="DistributeAmountTotal" />
            <asp:BoundField HeaderText="配送率" DataField="DistributeRate" DataFormatString="{0:P}" />
            <asp:BoundField HeaderText="入库数量" DataField="WareHouseCountTotal" />
            <asp:BoundField HeaderText="入库金额" DataField="WareHouseAmountTotal" />
            <asp:BoundField HeaderText="入库率" DataField="WareHouseRate" DataFormatString="{0:P}" />
            <asp:BoundField DataField="apm" HeaderText="排名" ReadOnly="true" />
        </Columns>
    </asp:GridView>
    <div>
        <span style="float: left; width: 30%">
            <hz:HzButton ID="btnExcel" runat="server" CssClass="btn" Text="导出数据" OnClick="btnExcel_Click" /></span><span
                style="float: right; width: 70%">
                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"
                    AlwaysShow="True" ShowPageSizeBox="True">
                </webdiyer:AspNetPager>
            </span>
    </div>
    <div class="listip">
        <ul>
            <li>说明:1.<span>此数据是静态数据，每24小时统计一次。</span> </li>
            <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.<span>配送率计算方式为：配送金额/采购金额；入库率计算方式为：入库金额/采购金额。</span>
            </li>
        </ul>
    </div>
</asp:Content>
